module.exports = (url) => {
    return new Promise((resolve, reject) => {
        const img = new Image();
        img.src = url;

        if (img.complete) {
            console.log('complete')
            return resolve('complete');
        }

        img.onload = () => {
            console.log('onload')
            resolve('onload');
        };

        img.onerror = () => {
            reject(new Error("image is 404"));
        };


    });
};